UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0alVELBAGqGS6MMiN/oMY4rMKkmihbpxxlkX/STTyis=' 
WHERE 
  key_id = 'fecb153c99c1665dfc963bef3efa2f4bbb1145369601c25f013c119c1f79be56' 
  AND (
    token = '0alVELBAGqGS6MMiN/oMY4rMKkmihbpxxlkX/STTyis=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032