UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WEI4/mHSsqBU5lrKedoqpdawQ9LD1EafcDSo9xLXgd8='
WHERE
key_id = '0a4d3e3a66cb471d93aa6d66cc85dc9dfee8c9e20a81bedaa06c9f15523bb749'
AND (
token = 'WEI4/mHSsqBU5lrKedoqpdawQ9LD1EafcDSo9xLXgd8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)