UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HFmgJa8099ik2GEUT71m70Tjpi0hdoh1wV5hL3/FwOA='
WHERE
key_id = 'e515a7dca37360fdd762c24ca027f782bd78ac8c9833edf77a012113769c73df'
AND (
token = 'HFmgJa8099ik2GEUT71m70Tjpi0hdoh1wV5hL3/FwOA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)