UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zT5t+1ggNwFrqZBiS/+8s546xOg2EdRU8YhNL3g8Ex8='
WHERE
key_id = 'dae5239cd69c1dcd27329457810d855e896f125ff23de8fbabda6bf72d15079d'
AND (
token = 'zT5t+1ggNwFrqZBiS/+8s546xOg2EdRU8YhNL3g8Ex8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)