UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'icV7Srbo7O2miP2fDDC/4EWQZiY5+7kE3iZeCRh4qaw=' 
WHERE 
  key_id = '454927652abde700b7c38ae2c80d0b7c48774882575da3246a25c9abdd3e10f9' 
  AND (
    token = 'icV7Srbo7O2miP2fDDC/4EWQZiY5+7kE3iZeCRh4qaw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037