UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Fni7o+anpoc2BJ0A8nrP6jRjY3T7kBbrDG1mDI+9aI='
WHERE
key_id = '448d2ab8422355d56f26f61218f3514f3743425668c1bc15b060e45573950c1c'
AND (
token = '3Fni7o+anpoc2BJ0A8nrP6jRjY3T7kBbrDG1mDI+9aI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)