UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/33MtBjmLepxL3diSmimwvRnlJrAa/mUeWimEA4Mgig=' 
WHERE 
  key_id = 'b98893f42e7a281e16fcd578146cfdadf5d26d5d31c626166c2f02ca61f919b9' 
  AND (
    token = '/33MtBjmLepxL3diSmimwvRnlJrAa/mUeWimEA4Mgig=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020