UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5mVRsHOfjztcWQY6eiszIC7/KaICVVvYjWr+3caV+ps='
WHERE
key_id = '167c269a7783c546ab39e42b190f2c8eab84ae2ac313b293e8e0c7dc417f2b4d'
AND (
token = '5mVRsHOfjztcWQY6eiszIC7/KaICVVvYjWr+3caV+ps='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)