UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3G/31I0DlMg48aR41ziMpj2LdN9prXcqc7v/rTHXtLo=' 
WHERE 
  key_id = '843b2aca698223945f6697fb6cb1a8dcaf5d5604cba86acc5c6b64523c03a895' 
  AND (
    token = '3G/31I0DlMg48aR41ziMpj2LdN9prXcqc7v/rTHXtLo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023