UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iMuRPP/g4DfiUfXKtrPZjVNEMzI0ndCSj6Hjx2u1wT0='
WHERE
key_id = '1b2089e15da0bc552cc1f8676812761b73eba8436b5f98409dfa9433d74ed73e'
AND (
token = 'iMuRPP/g4DfiUfXKtrPZjVNEMzI0ndCSj6Hjx2u1wT0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)