UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9GgKmi2ISD8LAb4yvDo5QKXeR6vxaGz1l/QB9tppGsg='
WHERE
key_id = 'c29fb4a7f5a753cc8703f1052450caf8ac39cedb074b6babc876a2839b6265f0'
AND (
token = '9GgKmi2ISD8LAb4yvDo5QKXeR6vxaGz1l/QB9tppGsg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)