UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HEfM6UoBoKxEPp6CuEzhfJcIrSqC4YXgtPx7057jsJI='
WHERE
key_id = '25171e0c64baa838f7dd63b8ec097dcdb1e57b9ae03268f0b4439272a4e423d6'
AND (
token = 'HEfM6UoBoKxEPp6CuEzhfJcIrSqC4YXgtPx7057jsJI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)