UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YUm2yduOSVVvabOo8UjXquRB7d0VYfMd4P7h3KK3Zhw='
WHERE
key_id = '6c8230cff037b383bf5706f8823dd33a95c41cee4d9fcc4d0ebbb6ca3440b6af'
AND (
token = 'YUm2yduOSVVvabOo8UjXquRB7d0VYfMd4P7h3KK3Zhw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)