UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DW4HfnDgIr0+JUYrDbz2VlXvE3cnj8NSubOjk4F15eU=' 
WHERE 
  key_id = 'ae3756bb50e8cfa38fd527a52c87e497e6db1b03adebfb5d4470def8738c653e' 
  AND (
    token = 'DW4HfnDgIr0+JUYrDbz2VlXvE3cnj8NSubOjk4F15eU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037