UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4OwqGf9geVr5+RursPVMQGLfGLPgHZQ0PCCV9awSJIk='
WHERE
key_id = '6fca9e32cf1bfd56b27478fc4b22805b788b8cff58a13123c56bd656d05b4f5c'
AND (
token = '4OwqGf9geVr5+RursPVMQGLfGLPgHZQ0PCCV9awSJIk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)