UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ELvGt8NP+cXX3IYCvnZpyodZbr1wICHwIrBLAix0S+0='
WHERE
key_id = 'eaa41db3be4fd9687a6931be71334739fbb9b686925aa0f5d90695d024b7c862'
AND (
token = 'ELvGt8NP+cXX3IYCvnZpyodZbr1wICHwIrBLAix0S+0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)