UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rGql/E1+m+MxjeqXydhtzbF6VEWChkkUtwGHgDXxWaM=' 
WHERE 
  key_id = 'becf59d730385ce33b8039bae1be2f0335bf75e4ff14ecd231fb838df6f2e37b' 
  AND (
    token = 'rGql/E1+m+MxjeqXydhtzbF6VEWChkkUtwGHgDXxWaM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023