UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Zxlhbcu2hVOlFZVett3RIEIrYlIlm3HpmFbPMJkF92g=' 
WHERE 
  key_id = '0974cb87e95882512cc5369e3583379340327c82717ae446b1d3bd289c083d0b' 
  AND (
    token = 'Zxlhbcu2hVOlFZVett3RIEIrYlIlm3HpmFbPMJkF92g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028