UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/MrlPGe7CaUTtem4Ao9hccZH3W6C/BYTjDse6deE2Zw='
WHERE
key_id = '18ab900cd920ec4371889e2905e7524e63295e95026c9c59dc4bf7e335fe7d0e'
AND (
token = '/MrlPGe7CaUTtem4Ao9hccZH3W6C/BYTjDse6deE2Zw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)