UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0DdByvAJZz9qkrQmDbotvNeeqNMZXGVJYFSmOjKq4cg='
WHERE
key_id = '95ca836d37cd85fdd1a8c9519709a23d59823548cc5cf02e52fa196f1b05415e'
AND (
token = '0DdByvAJZz9qkrQmDbotvNeeqNMZXGVJYFSmOjKq4cg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)