UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ekWTB6CmsyL8D+raowCxga2QQxUos+aYNZqE6v21rDQ=' 
WHERE 
  key_id = 'c54786a8e6e982d9c9c76ab9dd42e241b06730b3f7d3bd21c8580b54dcadcc7d' 
  AND (
    token = 'ekWTB6CmsyL8D+raowCxga2QQxUos+aYNZqE6v21rDQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031