UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QOj4JPyZcG+Ac3HLwAE1rweX6TPsU5SFS8tVbW2lqag=' 
WHERE 
  key_id = '11af4068b8b3e65fe94a750fd065978792f5d6f4d435f73a8d496a49aa7fd263' 
  AND (
    token = 'QOj4JPyZcG+Ac3HLwAE1rweX6TPsU5SFS8tVbW2lqag=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031