UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YzyYYWZoTLlm37FX/3pnSt5Zsf3vk1yLZemzVTEJpn8='
WHERE
key_id = '12573c3bbb24d5b8dbc99382cff3161ac335e11c7a7fe377a5cee76a085b03d7'
AND (
token = 'YzyYYWZoTLlm37FX/3pnSt5Zsf3vk1yLZemzVTEJpn8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)