UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V9ISxwcM5rLjF0tUDEezsYjZWmlB5yMmOAf+AwCx7xM=' 
WHERE 
  key_id = '23f850c0c8b4f0cab9146591c1ded54a8e17a290f8df040aac7aec384c2616a1' 
  AND (
    token = 'V9ISxwcM5rLjF0tUDEezsYjZWmlB5yMmOAf+AwCx7xM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062