UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e2/tyf/lOT4YQma5wToU/+qyueFW/8hSvvu3vs2Gh2c=' 
WHERE 
  key_id = '26e648579fcb6a0144385a7119ae5a8d0b15fb2579a34b79df906006165fdc14' 
  AND (
    token = 'e2/tyf/lOT4YQma5wToU/+qyueFW/8hSvvu3vs2Gh2c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028