UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ILP4CpUNJKTlB/L7m+mQ+x9eSRLYsor/BxjrbMzWsaw='
WHERE
key_id = '7bd4f5be190125f440facdfeceec6df3fac604598046441772d824a7390406cd'
AND (
token = 'ILP4CpUNJKTlB/L7m+mQ+x9eSRLYsor/BxjrbMzWsaw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)