UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5xgH2C3fN7JliCcLavEzRxN/0ziJ/XOZqz5yBbRmMkM='
WHERE
key_id = 'e1363656f2bea3fd6fd8b05973994cf3da63497f74af62f461368874c9cb948f'
AND (
token = '5xgH2C3fN7JliCcLavEzRxN/0ziJ/XOZqz5yBbRmMkM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)