UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CRm69ZCwNBhTQw9wLpcB5HxIauAV3xMdnwlyiMzbO78=' 
WHERE 
  key_id = '43415cfb5b771fab224da5c0194c43bdcc1e6cc4b16ee75924c3c6674c642d90' 
  AND (
    token = 'CRm69ZCwNBhTQw9wLpcB5HxIauAV3xMdnwlyiMzbO78=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00083