UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ic4w/xByVHHOoa5atr5KDZ34qRZEkCGsotPj5IbbpBE='
WHERE
key_id = '045c4c530cc7d77f3312e9f1d1568c487793655a4132a973b21eef418ececc5a'
AND (
token = 'Ic4w/xByVHHOoa5atr5KDZ34qRZEkCGsotPj5IbbpBE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)