UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RCpwvrKree2IBsZHI6DVHJs66Ox9GA0zxxsi3uVxWpw='
WHERE
key_id = '94ad461212c7ca6f7d71ed8153b231c5f64908c86e12029aaaae44069988f466'
AND (
token = 'RCpwvrKree2IBsZHI6DVHJs66Ox9GA0zxxsi3uVxWpw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)