UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EUqJ7jPFuXqt0wWligAX2aPFGb28IlHk9OPhPqM2O7s='
WHERE
key_id = 'de261b376d093e31d9c73ed5a47aea67b790b47d1c7ba7e4bc126e9b74a330a8'
AND (
token = 'EUqJ7jPFuXqt0wWligAX2aPFGb28IlHk9OPhPqM2O7s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)