UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '46ELA0M3Pnki+0HV/HyiATM3ZdOj0mfLFUR4jpKkNLw=' 
WHERE 
  key_id = '1959305d12eeb2ff6e6c4865363b9669edb6eaf6a539fb6acfcc229110f3aaf3' 
  AND (
    token = '46ELA0M3Pnki+0HV/HyiATM3ZdOj0mfLFUR4jpKkNLw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021