UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dIPChKEk1TRTpSQgI9vDUZp5f5WhaS1kK47P/clq1QQ=' 
WHERE 
  key_id = '65919ee75c7fd19d45717de16252a9370fa61427e0df8585c4ea32b177bbc7e6' 
  AND (
    token = 'dIPChKEk1TRTpSQgI9vDUZp5f5WhaS1kK47P/clq1QQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031