UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0X4wrOr/QvOOz89uyhS+p5CXNSgpLV+en/8Nzr2LzDA=' 
WHERE 
  key_id = 'bb926f388e7395530e007bd1c23821f5c6827dbe6441613f611f4c39298bacf6' 
  AND (
    token = '0X4wrOr/QvOOz89uyhS+p5CXNSgpLV+en/8Nzr2LzDA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036