UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I1wz2WIQeeW61DBQpIlqK3I5yZBylfd+L7i2j8WclLE=' 
WHERE 
  key_id = '92bb3e0759a82e62771b7ac593f99afa975b5b25770827e16a4c1a30b7e8b0da' 
  AND (
    token = 'I1wz2WIQeeW61DBQpIlqK3I5yZBylfd+L7i2j8WclLE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038