UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JiBM2q4PJ70zBAdqF8WdrjT5+wVpPnnblV0xWtBFAzE='
WHERE
key_id = '89559c57b4093721f527cc9c6372e4969dc4c563da02fd2dae8992605c63e8a3'
AND (
token = 'JiBM2q4PJ70zBAdqF8WdrjT5+wVpPnnblV0xWtBFAzE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)