UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hgkVI+uVWg/Wdr8Iqx8dehGKtic3O+r/snmxnEfrI9o=' 
WHERE 
  key_id = 'dde3c0cb1853526ed22f19ebc2e0906290aada8a8d7caeffd00f22ba0d5ccaf0' 
  AND (
    token = 'hgkVI+uVWg/Wdr8Iqx8dehGKtic3O+r/snmxnEfrI9o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034