UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L+8PpkCJbfzLZNGoF/6JNUXXbnBcao4wU//uf/hzS60=' 
WHERE 
  key_id = '2263ec55a18cf6315894ed5691212cd63d01b065014d97865a70c471ef1df15a' 
  AND (
    token = 'L+8PpkCJbfzLZNGoF/6JNUXXbnBcao4wU//uf/hzS60=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033