UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xC1f8QsEB/QOcxyRkRMhp2Y1ra2Uv1A/5yajc8RGfUU='
WHERE
key_id = '796d0b73ecf41d105e9e108bfe4ee62b33ca6caa48927aac1d8eb614017cff89'
AND (
token = 'xC1f8QsEB/QOcxyRkRMhp2Y1ra2Uv1A/5yajc8RGfUU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)