UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yJWeCjlmRGzsUiAEWg7jskqD5bJBCtW04aNgdtL7l00=' 
WHERE 
  key_id = '6efc8d371e80ab52bad6368ac4a48c0168e99ae1405901479c997be476027023' 
  AND (
    token = 'yJWeCjlmRGzsUiAEWg7jskqD5bJBCtW04aNgdtL7l00=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042