UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dBabQwXvIJ7fv0LVc2+VgeJzl9BWXpNpCU8yjsZvsDc='
WHERE
key_id = '741e4a3193aef3b26bd233247f73b8eb07f0809d31a989eda9a674a98a7aa9f9'
AND (
token = 'dBabQwXvIJ7fv0LVc2+VgeJzl9BWXpNpCU8yjsZvsDc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)