UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dtrTIE6cYHwTkqevgFNDEzbggYTQT/qRCcfcpF1nsgw=' 
WHERE 
  key_id = '95605f4bdc486991c9fa4b85e1f3f1f030fdd06f97d9f4e7a0cf84901a4f8748' 
  AND (
    token = 'dtrTIE6cYHwTkqevgFNDEzbggYTQT/qRCcfcpF1nsgw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049