UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I95QMKsUSWb5qTWiHwLNhrgSARohbDS2m634ghXZ+iA='
WHERE
key_id = 'a5cbb1da0d427b62916cf3cafb615c62bb2aab3d1a28481664aaa49741f7911f'
AND (
token = 'I95QMKsUSWb5qTWiHwLNhrgSARohbDS2m634ghXZ+iA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)