UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BKVl3VuBQJ3aDQk9ELN/vgj356Z9I2dPXTID0DDx0dY=' 
WHERE 
  key_id = '92a9e0576d3b11176e72eeb691b2f6b4948bb3691f62f35bcedfd51d3bf9878c' 
  AND (
    token = 'BKVl3VuBQJ3aDQk9ELN/vgj356Z9I2dPXTID0DDx0dY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037