UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5+gBDaDA7JErOZuvtXeX1e+Et2+QsxlZMkv+b/LWYE4='
WHERE
key_id = 'bcfe69a24cf50d0210eeedaf1d4220335655857e77b1dfb0699aa1f7612ab49a'
AND (
token = '5+gBDaDA7JErOZuvtXeX1e+Et2+QsxlZMkv+b/LWYE4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)