UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lgoVcQ1pqTU7xH4eAFeJ19shI6ypwC6MhptWRNzFFpA=' 
WHERE 
  key_id = '2d35d5ba465c77aed0ba4fe7c9df1e3d36c516c8d53001b99831754ed7c88ff8' 
  AND (
    token = 'lgoVcQ1pqTU7xH4eAFeJ19shI6ypwC6MhptWRNzFFpA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031