UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '31JcsqIOw3jgRRqWnqO8am7YvmqUTYUUWR6H6Xx5Ni8=' 
WHERE 
  key_id = 'd21972e70c8694d8d3bf5d06ee8abc76af54ec8409ab7f21143352d3f15bd95d' 
  AND (
    token = '31JcsqIOw3jgRRqWnqO8am7YvmqUTYUUWR6H6Xx5Ni8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027