UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tqRVXK/QE95/cUfFjDOStwbzYUcoe9Wybqd1yOjdi2E='
WHERE
key_id = 'd4b624f0739934c4f9c2dd32854723b8a5228236b0ae4f8b0bd0e5e960b7c6ac'
AND (
token = 'tqRVXK/QE95/cUfFjDOStwbzYUcoe9Wybqd1yOjdi2E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)