UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eDzDlYwDQ57DIQVPCcq1tjgAwcQnSHjLJ156dL1ME/o=' 
WHERE 
  key_id = 'e0e9c4d2e23311767f79e1828710d8f6f58a675a5b7213af3ce8ff4a6a21758e' 
  AND (
    token = 'eDzDlYwDQ57DIQVPCcq1tjgAwcQnSHjLJ156dL1ME/o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040