UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CusICTRxh5Q3o2v6vGU0CTp94YKPhWcLPUfHsr52q5I=' 
WHERE 
  key_id = '07ada403861519c5b30c9ce4e3aeaf83080543670601e4910d2f3aa9827967b3' 
  AND (
    token = 'CusICTRxh5Q3o2v6vGU0CTp94YKPhWcLPUfHsr52q5I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050