UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zloZOP39zyUN75B8TAWRjWsULHOGOE/leFYrVJTXU2I=' 
WHERE 
  key_id = '7f0ef2d5ecf598fdd41582fbfa3845bf9d556aff5e2154dd17290d69108305d0' 
  AND (
    token = 'zloZOP39zyUN75B8TAWRjWsULHOGOE/leFYrVJTXU2I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020