UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EFbtphlMQ34Zffmnk8lmN01vEN7qn6/1RBtA/tqDaew='
WHERE
key_id = 'a7af75c5ee0a78bd76094a8ed0f107a63a003b54668d2823dcd558376d93f827'
AND (
token = 'EFbtphlMQ34Zffmnk8lmN01vEN7qn6/1RBtA/tqDaew='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)