UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N9GV/KiuHby+wUidQi9xItF0piw/hwFIZpQz3Ly1P7w=' 
WHERE 
  key_id = '4b2059c0063f22420f5a109364068e6869ffc8276f03dd5d72b779e9e7a0355b' 
  AND (
    token = 'N9GV/KiuHby+wUidQi9xItF0piw/hwFIZpQz3Ly1P7w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030