UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/txHxiAUPS+wJNyxKL6QSry8/WqW+MRvLuu6vSFcT4M='
WHERE
key_id = '6ec6f201f641d07f4bd38447834249dfee78f4b5c6943f54c54c4e3bf11a54ee'
AND (
token = '/txHxiAUPS+wJNyxKL6QSry8/WqW+MRvLuu6vSFcT4M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)