UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ks1CqYocQkKyhNNBH08Kuc/LX4WHmFxZXDwKoXuEFR8='
WHERE
key_id = 'e25e881c3030055805adc1fcea027f15bb8ea637d6d1d76d42f5300ac6dce067'
AND (
token = 'ks1CqYocQkKyhNNBH08Kuc/LX4WHmFxZXDwKoXuEFR8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)