UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MtjGyijjLt5/LP+Lx/+dt0hdfr+pQkqqI/TiWCSdAEA='
WHERE
key_id = '84b572f14d0e08a644445c7200786263809325b5b411be0a8ee48e911c5cc1b3'
AND (
token = 'MtjGyijjLt5/LP+Lx/+dt0hdfr+pQkqqI/TiWCSdAEA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)