UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wg84lxe5NJK6bHqLJ8M4dzTPuIoJMzYlITVXTyiqvF8=' 
WHERE 
  key_id = '7f70271e229f2654677d0f771c376186b88b08bf57182c7ff4f3072b60c89a7b' 
  AND (
    token = 'Wg84lxe5NJK6bHqLJ8M4dzTPuIoJMzYlITVXTyiqvF8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048