UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xh90TVzIQ2JTU2TAqAV3XSIk26/cGLs9tddTTjbA3us=' 
WHERE 
  key_id = '72cfd0a0dfb8e84eb846818e8dd0abbffeea5aa7f509f94893cb030cf056a89a' 
  AND (
    token = 'xh90TVzIQ2JTU2TAqAV3XSIk26/cGLs9tddTTjbA3us=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058