UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '81nXBHZLCS3FA9e3bZMTRtKVTUC3ldRPWi9g1Rv16XY='
WHERE
key_id = '5f1520a790cb7e989eed62d7d60c19da8ee1ad8f98fefbd4952096a869af3d5b'
AND (
token = '81nXBHZLCS3FA9e3bZMTRtKVTUC3ldRPWi9g1Rv16XY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)